package org.wu.framework.lazy.orm.core.config;

import java.util.Arrays;
import java.util.List;

public class DefaultLazyOperationAttribute extends AbstractLazyOperationAttribute{

    /**
     * 打印sql
     */
    boolean printfQuery = false;

    /**
     * 使用；lazy 框架设置schema，自动创建数据库
     * 如：默认url连接
     * spring:
     * datasource:
     * url: jdbc:mysql://127.0.0.1:3306/information_schema?allowMultiQueries=true&useUnicode=true&autoReconnect=true&useAffectedRows=true&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&databaseTerm=SCHEMA
     * username: root #有权限创建数据
     * password: wujiawei
     * driver-class-name: com.mysql.cj.jdbc.Driver
     *
     * @see org.wu.framework.inner.lazy.database.expand.database.persistence.factory.config.LazySchemaAutoCreateProcessor
     */
    private boolean enableAutoSchema = false;
    /**
     * 自动填充忽略的数据库
     */
    private List<String> ignoredDatabase = Arrays.asList("mysql", "information_schema", "performance_schema", "sys");
    /**
     * 自动填充时 填充忽略的字段 自增的、含有默认值、可以为null的字段
     */
    private List<String> fillIgnoredFields = Arrays.asList("id");
    /**
     * 自动填充时 最大条数(触发后使用多线程处理)
     */
    private Long fillMaximum = 1024L;
    /**
     * DDL  操作
     *
     * @see LazyOperationAttribute#ddlConfigure
     */

    /**
     * ddlConfigure 配置
     */
    private DdlConfigure ddlConfigure = new DdlConfigure();
    /**
     * 允许逆向工程 为true时 ReverseEngineering 有效
     */
    private boolean enableReverseEngineering = false;
    /**
     * 事件队列名称
     */
    private String eventQueueName="default_lazy_orm_event";

    /**
     * 逆向工程
     */
    private ReverseEngineering reverseEngineering = new ReverseEngineering();
    @Override
    public boolean isPrintfQuery() {
        return false;
    }

    @Override
    public void setPrintfQuery(boolean printfQuery) {

    }

    @Override
    public boolean isEnableAutoSchema() {
        return enableAutoSchema;
    }

    @Override
    public void setEnableAutoSchema(boolean enableAutoSchema) {
        this.enableAutoSchema = enableAutoSchema;
    }

    @Override
    public List<String> getIgnoredDatabase() {
        return ignoredDatabase;
    }

    @Override
    public void setIgnoredDatabase(List<String> ignoredDatabase) {
        this.ignoredDatabase = ignoredDatabase;
    }

    @Override
    public List<String> getFillIgnoredFields() {
        return fillIgnoredFields;
    }

    @Override
    public void setFillIgnoredFields(List<String> fillIgnoredFields) {
        this.fillIgnoredFields = fillIgnoredFields;
    }

    @Override
    public Long getFillMaximum() {
        return fillMaximum;
    }

    @Override
    public void setFillMaximum(Long fillMaximum) {
        this.fillMaximum = fillMaximum;
    }

    @Override
    public boolean isEnableReverseEngineering() {
        return enableReverseEngineering;
    }

    @Override
    public void setEnableReverseEngineering(boolean enableReverseEngineering) {
        this.enableReverseEngineering = enableReverseEngineering;
    }

    @Override
    public ReverseEngineering getReverseEngineering() {
        return reverseEngineering;
    }

    @Override
    public void setReverseEngineering(ReverseEngineering reverseEngineering) {
        this.reverseEngineering = reverseEngineering;
    }

    @Override
    public String getEventQueueName() {
        return eventQueueName;
    }

    @Override
    public void setEventQueueName(String eventQueueName) {
        this.eventQueueName = eventQueueName;
    }
}
